#!/bin/bash

echo "DIRs"
find ./src -type d  | wc -l
echo "FILEs"
find ./src -type f  | wc -l
echo "LINEs"
find ./src -name "*.go" |xargs cat|grep -v ^$|wc -l
echo "DETAILs"
find ./src -type f -name "*.go" | xargs wc -l | sort -n

files=`find ./src -type f -name "*.go" |xargs`
for file in $files; do
    gofmt -s -w ${file}
done

rm -f ./bin/lesskeeper

go build -ldflags "-w -s" -o ./bin/lesskeeper-cli ./src/cli.go 
go build -ldflags "-w -s" -o ./bin/lesskeeper ./src/main.go 

./bin/lesskeeper -log_dir="./var/log"

